<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>

<jsp:useBean id="oLogon" class="git.bankview.wl.bean.LogonBean" scope="session" />

<html style="font-family: SimSun;" id='scroll'>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="<%=request.getContextPath()%>/ext/core/ext/resources/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/style.css" type="text/css"></link>
<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/ext/core/ext/resources/css/ext-all.css" />

<script type="text/javascript"
	src="<%=request.getContextPath()%>/ext/core/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/ext/core/ext/ext-all.js"></script>

<script type="text/javascript">
	// 改变图片
	function changeback(obj){
		if( obj.id == "but1" ){
			obj.className = "BtnStyle01";
		}else if (obj.id == "but2" ){
			obj.className = "BtnStyle02";
		}else if (obj.id == "but3" ){
			obj.className = "BtnStyle03";
		}else if (obj.id == "but4" ){
			obj.className = "BtnStyle04";
		}
	}
	
	// 恢复图片
	function redoback(obj){
		if( obj.id == "but1" ){
			obj.className = "BtnStyle1";
		}else if (obj.id == "but2" ){
			obj.className = "BtnStyle2";
		}else if (obj.id == "but3" ){
			obj.className = "BtnStyle3";
		}else if (obj.id == "but4" ){
			obj.className = "BtnStyle4";
		}else if (obj.id == "but5" ){
			obj.className = "BtnStyle4";
		}
	}
	
	// 点击时触发的事件
	function changeLink(obj){
		if( obj.id == "but1" ){
		
		}else if (obj.id == "but2" ){
			
		}else if (obj.id == "but3" ){
			//parent.window.document.forms[0].submit();

			var pageName = parent.window.document.getElementById("uname").value;
			var pagePath = parent.window.document.getElementById("upath").value;
			var userId = parent.window.document.getElementById("userid").value;



			Ext.Ajax.request( {
			    url :'/bidevapp/center.do?action=insertShortcut',
			    success : function(response) {
			      var resobject = eval("(" + response.responseText + ")");

			      if(resobject.existFlag){
						alert("此数据已存在！");
				  }else{
					  if(resobject.insertFlag){
				    	  alert('保存成功！');
					  }else{
						  alert('保存失败！');
					  }
				  }
			    },
			    failure : function(response) {
			      alert('保存失败！');
			    },
			    params: {
			    	pageName: pageName,
			    	pagePath: pagePath,
			    	userId:   userId
				    
				}
			  });
			
			
		}else if (obj.id == "but4" ){
			//默认页面
			var pageURL = parent.window.document.getElementById("upath").value;
			var userId = '<%=oLogon.getUsername()%>';

			Ext.Ajax.request( {
			    url :'/bidevapp/center.do?action=saveDefaultPage',
			    success : function(response) {
			      var resobject = eval("(" + response.responseText + ")");
			      if(resobject.success){
			    	  alert('保存成功！');
				   }else{
					  alert('保存失败！');
				   }
			      
			    },
			    failure : function(response) {
			      alert('保存失败！');
			    },
			    params: {
			    	pageURL: pageURL,
			    	userId:  userId
				}
			  });
			
		}else if (obj.di == "but5" ){

		}
	}
</script>
</head>

<body style="overflow:hidden">
<div class="top">
	<div class="top-left"></div>
	<div class="top-right"></div>
	<div style="position:absolute;right: 50px;"><input type="button" value="" class="BtnStyle1" id="but1" onmouseover="changeback(this);" onmouseout="redoback(this);"></div>
	<div style="position:absolute;right: 112px;"><a href="javascript: close();" target="_top" class="BtnStyle2" id="but2" onmouseover="changeback(this);" onmouseout="redoback(this);"></a></div>
	<div style="position:absolute;right: 174px;"><input type="button" value="" class="BtnStyle3" id="but3" onclick="changeLink(this);" onmouseout="redoback(this);"></div>
	<div style="position:absolute;right: 236px;"><input type="button" value="" class="BtnStyle4" id="but4" onclick="changeLink(this);" onmouseout="redoback(this);"></div>
	<div style="position:absolute;right: 298px;"><a href="main.jsp" target="_top" class="BtnStyle4" id="but5" onmouseover="changeback(this);" onmouseout="redoback(this);"></a></div>
	
	
</div>

</body>
</html>
